#include "ui_bofugui.h"
#include "bofugui.h"

/********************************************************************************************/

//enables the diarySafe-button if text is not empty
void BofuGui::enableDiarySafeButton(){
    ui->pushButton_DiarySafe->setEnabled(1);
}

void BofuGui::on_pushButton_DiarySafe_clicked()
{
    QFile diary(""+dir.absolutePath()+"/"+korpusname+".txt");
    if(!diary.open(QFile::WriteOnly | QFile::Truncate))
        return;
    QTextStream diary_out(&diary);
   diary_out << ui->plainTextEdit_Diary->toPlainText().toLocal8Bit().data();
    diary.close();
    ui->pushButton_DiarySafe->setEnabled(0);
}

/********************************************************************************************/
